from django.urls import path
from . import views



urlpatterns = [
    path('', views.index, name='index'),
    path('login/', views.login_view, name='login'),
    path('logout/', views.logout_view, name='logout'),
    path('alert/<int:alert_id>/<str:action>/', views.handle_alert, name='handle_alert'),
    
    # 主机管理URLs
    path('hosts/', views.host_list, name='host_list'),
    path('hosts/add/', views.host_add, name='host_add'),
    path('hosts/<int:pk>/', views.host_detail, name='host_detail'),
    path('hosts/<int:pk>/edit/', views.host_edit, name='host_edit'),
    path('hosts/<int:pk>/delete/', views.host_delete, name='host_delete'),
    path('hosts/export/', views.export_hosts, name='export_hosts'),
    path('hosts/import/', views.import_hosts, name='import_hosts'),
    path('hosts/template/', views.download_template, name='download_template'),
    path('hosts/discover/', views.auto_discover, name='auto_discover'),
    path('task-info/', views.get_task_info, name='task_info'),
    path('task-status/<str:task_id>/', views.get_task_status, name='task_status'),
    path('task-cancel/<str:task_id>/', views.cancel_task, name='task_cancel'),
    path('hosts/batch-delete/', views.batch_delete, name='batch_delete'),
    path('hosts/batch-enable/', views.batch_enable, name='batch_enable'),
    path('hosts/batch-disable/', views.batch_disable, name='batch_disable'),
    path('hosts/batch-update/', views.batch_update_hosts, name='batch_update_hosts'),
    
    # 网络设备管理URLs
    path('network-devices/', views.NetworkDeviceListView.as_view(), name='network_device_list'),
    path('network-devices/add/', views.NetworkDeviceCreateView.as_view(), name='network_device_create'),
    path('network-devices/<int:pk>/edit/', views.NetworkDeviceUpdateView.as_view(), name='network_device_update'),
    path('network-devices/<int:pk>/delete/', views.NetworkDeviceDeleteView.as_view(), name='network_device_delete'),
    
    # 网络设备管理相关的 URL
    path('network-device-list/', views.network_device_list, name='network_device_list'),
    path('network-device/add/', views.network_device_add, name='network_device_add'),
    path('network-device/<int:pk>/edit/', views.network_device_edit, name='network_device_edit'),
    path('network-device/<int:pk>/delete/', views.network_device_delete, name='network_device_delete'),
    path('network-device/batch-update/', views.batch_update_network_devices, name='batch_update_network_devices'),
    path('network-device/import/', views.import_network_devices, name='import_network_devices'),
    path('network-device/export/', views.export_network_devices, name='export_network_devices'),
    path('network-device/template/download/', views.download_network_template, name='download_network_template'),
    path('idc/', views.idc_list, name='idc_list'),
    path('idc/<int:idc_id>/', views.idc_detail, name='idc_detail'),
    path('idc/<int:idc_id>/3d/', views.idc_3d_view, name='idc_3d'),
    path('idc/<int:idc_id>/3d/get-devices/', views.get_devices, name='get_devices'),
    path('idc/<int:idc_id>/save-devices/', views.save_devices, name='save_devices'),
    path('alert-notification/', views.alert_notification, name='alert_notification'),
    path('alert-notification/get/', views.get_notification, name='get_notification'),
    path('alert-notification/create/', views.create_notification, name='create_notification'),
    path('alert-notification/update/', views.update_notification, name='update_notification'),
    path('alert-notification/delete/', views.delete_notification, name='delete_notification'),
    path('alert-notification/toggle/', views.toggle_notification, name='toggle_notification'),
    path('alert-notification/test/', views.test_notification, name='test_notification'),
    path('user-management/', views.user_management, name='user_management'),
    path('user/get/', views.get_user, name='get_user'),
    path('user/create/', views.create_user, name='create_user'),
    path('user/update/', views.update_user, name='update_user'),
    path('user/toggle-status/', views.toggle_user_status, name='toggle_user_status'),
    path('user/reset-password/', views.reset_password, name='reset_password'),
    path('reports/', views.reports, name='reports'),
    path('alerts/', views.alerts, name='alerts'),
    path('alerts/acknowledge/', views.acknowledge_alerts, name='acknowledge_alerts'),
    path('alerts/clear/', views.clear_alerts, name='clear_alerts'),
    path('dashboard/', views.dashboard, name='dashboard'),
    path('api/dashboard-data/', views.dashboard_data, name='dashboard_data'),
    path('topology/', views.topology, name='topology'),
    path('idc/add/', views.add_idc, name='add_idc'),
    path('rack/add/', views.add_rack, name='add_rack'),
    path('rack/<int:rack_id>/edit/', views.edit_rack, name='edit_rack'),
    path('rack/<int:rack_id>/delete/', views.delete_rack, name='delete_rack'),
    path('rack/<int:rack_id>/info/', views.get_rack_info, name='get_rack_info'),
    path('asset-management/', views.asset_management, name='asset_management'),
    path('asset/create/', views.asset_create, name='asset_create'),
    path('asset/<int:pk>/edit/', views.asset_edit, name='asset_edit'),
    path('asset/<int:pk>/delete/', views.asset_delete, name='asset_delete'),
    path('asset-category/create/', views.asset_category_create, name='asset_category_create'),
    path('responsible-person/create/', views.responsible_person_create, name='responsible_person_create'),
    path('notifications/test-smtp/', views.test_smtp_config, name='test_smtp_config'),
    path('notifications/test-sms/', views.test_sms_config, name='test_sms_config'),
    path('api/cabinets/', views.get_cabinets, name='get_cabinets'),
    path('api/device-types/', views.get_device_types, name='get_device_types'),
    path('api/devices/type/<int:type_id>/', views.get_devices_by_type, name='get_devices_by_type'),
    path('api/cabinet/free-units/<int:cabinet_id>/', views.get_cabinet_free_units, name='cabinet_free_units'),

] 